package daoDataFactory;

import java.sql.*;

import daoInterface.DaoICategorie;
import daoInterface.DaoIConsumtie;
import daoInterface.DaoIDrank;
import daoInterface.DaoIGerecht;
import daoInterface.DaoIMenu;
import daoInterface.DaoITafel;
import daoMySQL.MySQLCategorie;
import daoMySQL.MySQLConsumtie;
import daoMySQL.MySQLDrank;
import daoMySQL.MySQLGerecht;
import daoMySQL.MySQLMenu;
import daoMySQL.MySQLTafel;

public class DbObject extends DaoFactory{

	private String url = "jdbc:mysql://martcor.nl:3306/deb42181_daxin";
	private String user = "deb42181_daxin";
	private String password = "U9dJ9hZO";
	
	private Connection conn = null;
	
	
	public Connection openConnection(){
		try{
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			conn = (Connection) DriverManager.getConnection(url,user,password);
			}
		catch (Exception e){
			System.out.println(e.getMessage());
		}
		return conn;
	}

	@Override
	public DaoIGerecht getDaoIGerecht() {
		return MySQLGerecht.instance();
	}

	@Override
	public DaoIDrank getDaoIDrank() {
		return MySQLDrank.instance();
	}

	@Override
	public DaoICategorie getDaoICategorie() {
		return MySQLCategorie.instance();
	}

	@Override
	public DaoITafel getDaoITafel() {
		return MySQLTafel.instance();
	}

	@Override
	public DaoIMenu getDaoIMenu() {
		return MySQLMenu.instance();
	}
    @Override
    public DaoIConsumtie getDaoIConsumtie() {
            return MySQLConsumtie.instance();
    }
}
